package servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "Servlet16", value = "/father")
public class Servlet16 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String money = request.getParameter("money");
        System.out.println("（爸爸）孩子本次需要:"+money+"元");
        Integer n = Integer.valueOf(money);
        double nn=n*1.2;//父亲应给孩子的钱
        //服务器之间传递参数
        request.getRequestDispatcher("/mother").forward(request,response);


    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
